import { lazy } from "react";
import { useRoutes } from "react-router-dom";

const Login = lazy(()=>import('../views/login/Login.jsx'));
const Register = lazy(()=>import('../views/register/Register.jsx'));
const ForgetPwd = lazy(()=>import('../views/ForgetPwd/ForgetPwd.jsx'));


const routes = [
    {
        path:'/login',
        name:'登录',
        element:<Login />
    },
    {
        path:'/register',
        name:'注册',
        element:<Register />
    },
    {
        path:'/forgetpwd',
        name:'忘记密码',
        element:<ForgetPwd />
    },
];

function MyRouter(){
    return useRoutes(routes);
};
export default MyRouter;